<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="ko">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>배너관리(서브)</title>
	<link type="text/css" href="../lib/calendar/themes/base/ui.all.css" rel="stylesheet" />
	<script src="../js/jquery.js" type="text/javascript"></script>
	<script src="../js/validator.js" type="text/javascript"></script>
	<script src="../lib/calendar/ui/ui.core.js" type="text/javascript"></script>
	<script src="../lib/calendar/ui/ui.datepicker-ko.js" type="text/javascript"></script>
	<script src="../lib/calendar/ui/ui.datepicker.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(function() {
			//달력 로직
			var date = new Array('banner_display_sdt','banner_display_edt');
			
			for (var i = 0; i < date.length; i++) {
				$('#' + date[i]).datepicker({
					changeMonth: true,
					changeYear: true,
					yearRange: '2012:2020'
				});		
			}
		});	
	
		//check validity
	    function reg(frm)
	    {
			if(!checkAuth()) return false;
	    	if (frm.file_relate_id.value == ""){	alert("파일을 첨부하세요");			return false;}
	    	if (!isTextValidate(frm.banner_title, "string", 0, "배너 이름"))			return false;
	    	if (!isTextValidate(frm.banner_url, "string", 0, "배너 주소"))				return false;
	    	if (!isTextValidate(frm.banner_desc, "string", 0, "배너 설명"))			return false;
	    	if (!isTextValidate(frm.banner_display_sdt, "string", 0, "게시 시작일"))	return false;
	    	if (!isTextValidate(frm.banner_display_edt, "string", 0, "게시 종료일"))	return false;
			
			return true;
	    }
    </script>
</head>
<body>
	<!-- 본문 영역 -->
	<div id="contents">
		<!-- 제목 및 Location 영역 -->
		<div id="location">
			<h3 id="contentTitle"></h3>
			<div id="locationPath"></div>
		</div>
		<script type="text/javascript">
		// 현재 메뉴 경로를 설정한다.
		var pagePath = licationPth.split("_");
		var pathStr = "홈";
		for( var i=0; i < pagePath.length; i++ )
		{
			if (i+1 >= pagePath.length)
				pathStr += " &gt; <strong>" + pagePath[i] + "</strong>";
			else
				pathStr += " &gt; " + pagePath[i]
		}
		document.getElementById("contentTitle").innerHTML = pagePath[ pagePath.length - 1 ];
		document.getElementById("locationPath").innerHTML = pathStr;
		</script>

		<!-- 본문 내용 -->
		<div id="content">
			<form name="writeFrm" method="post" action="../admin/sub_bannermng_proc.do" enctype="multipart/form-data" onsubmit="return reg(this);">
			<input type="hidden" name="mode" value="write" />
			<input type="hidden" name="banner_sort" value="3" checked/>
			<div class="ar">
				<span class="button btnProc01"><input type="submit" value="저장" /></span>
				<span class="button btnProc01"><a href="#" onclick="history.go(-1); return false;">취소</a></span>
			</div>
			<table cellspacing="0" cellpadding="0" border="0" class="tbl_type04">
				<colgroup>
					<col width="150px" />
				</colgroup>
				<thead>
					<th colspan="2">배너 등록 (서브)</th>
				</thead>
				<tbody>
					<tr>
						<th>파일 첨부</th>
						<td><input type="file" name="file_relate_id"/></td>
					</tr>
					<tr>
						<th>배너 이름 (서브)</th>
						<td><input type="text" name="banner_title" size="20" maxlength="12" /> (12자리 이내)</td>
					</tr>
					<tr>
						<th>배너 주소 (서브)</th>
						<td><input type="text" name="banner_url" size="30" maxlength="50" /></td>
					</tr>
					<tr>
						<th>배너 설명 (서브)</th>
						<td><textarea rows="3" cols="40" name="banner_desc"></textarea></td>
					</tr>
					<tr>
						<th>표시 여부</th>
						<td>
							<input type="radio" name="banner_display_yn" value="Y" checked/> 사용
							<input type="radio" name="banner_display_yn" value="N"/> 미사용
						</td>
					</tr>
					<tr>
						<th>게시 날짜</th>
						<td>
							<input type="text" name="banner_display_sdt" id="banner_display_sdt" size="10">시작일
							<input type="text" name="banner_display_edt" id="banner_display_edt" size="10">종료일
						</td>
					</tr>
				</tbody>
			</table>
			</form>
		</div>
	</div>
</body>
</html>
